package com.uetoken.cn.adapter;

import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.blankj.utilcode.util.ScreenUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.uetoken.cn.R;

import java.util.List;

/**
 * @author 谢杨
 * @time 2018/9/11 15:49
 * @class 描述:
 */
public class FeedBackImgAdapter extends BaseQuickAdapter<Drawable,BaseViewHolder> {
    public FeedBackImgAdapter(int layoutResId, @Nullable List<Drawable> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Drawable item) {
        ImageView imageView =  helper.getView(R.id.iv_item_feed_back_imag);
        RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) imageView.getLayoutParams();
        layoutParams.width = ScreenUtils.getScreenWidth()/4;
        layoutParams.height = ScreenUtils.getScreenWidth()/4;
        imageView.setLayoutParams(layoutParams);

        imageView.setImageDrawable(item);
    }
}
